<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="../jquery-3.2.1.min.js"></script>
    <script src="jweixin-1.6.0.js"></script>
    <script src="wechatShare.js"></script>
    <script>
        $(function() {
            $.ajax({
                url: "/jssdkSignature",
                type: "POST",
                cache: false,
                dataType: "JSON",
                data: {
                    "url": encodeURIComponent(window.location.href.split('#')[0])
                },
                success: function(res) {
                    console.log("接口jssdkSignature返回数据：");
                    console.log(res);
                    if (res.code == 0) {
                        var data = res.data;
                        data.jsApiList = ["onMenuShareAppMessage", "onMenuShareTimeline"];
                        data.appId = 'wx5f207b761c92e9c6'; //如果没有的话，手动配置
                        wx.config(data);
                    }
                },
                error: function(res) {}
            });
        })
    </script>
</body>

</html>